package javase0830;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.Date;

public class Demo01 {
    public static void main(String[] args) throws Exception {
        Date d = new Date();
        System.out.println((d.getYear() + 1900) + ":"
                + (d.getMonth() + 1) + ":" + d.getDate());
        // 2023:08:30
        //  123:07:03
        // 1900:01:27

        d = new Date(0);
        System.out.println((d.getYear() + 1900) + ":"
                + (d.getMonth() + 1) + ":" + d.getDate());

        System.out.println("---------------");

        File f = new File("file0830");
        if (!f.exists()) {
            f.createNewFile();
        }
        FileOutputStream fos = new FileOutputStream(f, true);
        String s = "123456";
        fos.write(s.getBytes());
        fos.flush();
        fos.close();

        FileInputStream fis = new FileInputStream(f);
        System.out.println(fis.available());
        fis.read();
        System.out.println(fis.read());
        System.out.println(fis.read());
        System.out.println(fis.available());
        /*
        byte[] arr = null;
        String r = new String(arr);
        System.out.println(r);*/

        char c = 50;
        System.out.println(c);
    }

}
